import { legacy_createStore as createStore} from 'redux'

const initState = {
	count: 1
}

const reducer = (state = initState, action: any) => {
	if(action.type === 'add') {
		return {
			...state,
			count: state.count + 1
		}
	}
	return state
}

export const store = createStore(reducer)

// const state = store.getState()
// console.log(state);

// store.dispatch({ type: 'add' })

// const state1 = store.getState()
// console.log(state1);
